package com.zhihuichongcheng.application.ui;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import com.zhihuichongcheng.application.R;
import com.zhihuichongcheng.application.base.BaseActivity;
import com.zhihuichongcheng.application.bean.mine.UserBean;
import com.zhihuichongcheng.application.ui.main.activity.MainActivity;
import com.zhihuichongcheng.application.ui.mine.LoginActivity;

/**
 * Created by 3water on 2016/10/26.
 */

public class StartActivity extends BaseActivity {
    private Handler mHandler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isStartAnimation = false;
        setContentView(R.layout.activity_start);
        setStatusBarDarkMode();
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                UserBean bean = app.getUser();
                if (bean == null) {
                    startActivity(LoginActivity.class);
                } else {
                    startActivity(MainActivity.class);
                }
                finish();
            }
        }, 5000);

    }

    @Override
    public void onBackPressed() {
    }
}



